package com.example.shixunandjavagotoyangchen.BoosYang.Day002.Day002_1104;

import com.example.modelviewpresenter.Model.BasterModel;

import java.util.List;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

/**
 * 作者:二徒
 * 时间：2021/11/2- 15:24
 * 功能实现：
 */
public class WomenswearModel  extends BasterModel implements WomenswearContion.moder {
    @Override
    public void getmoder(String name, WomenswearCallback callbck) {
        WomenswearOKhttp.getOkhttp().getRetrofit().create(WomenswearApi.class).getwomenswear(name)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.computation())
                .subscribe(new Observer<WomenswearBean>() {
                    @Override
                    public void onSubscribe(Disposable d) {

                    }

                    @Override
                    public void onNext(WomenswearBean womenswearBean) {
                        List<WomenswearBean.ShujuBean> shujuBeans = womenswearBean.getShuju();
                        callbck.suees(shujuBeans);
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }
}
